export function nearest(arr, target) {
    return arr.reduce((pre, cur) => {
        return Math.abs(pre - target) < Math.abs(cur - target) ? pre : cur
    })
}
